<?php 
	require_once('dao/configuration.php'); 
	require_once('dao/timeattendance.php'); 
	$_SESSION['curl'] = $curl; 
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="../js/uploadify/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../js/uploadify/swfobject.js"></script>
<script type="text/javascript" src="../js/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="../js/jquery.fancybox-1.3.4/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="../js/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js"></script>


<link href="../js/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<link href="../css/redmond/jquery-ui-1.8.16.custom.css" type="text/css" rel="stylesheet" />
<link href="../css/core.css" type="text/css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="../js/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.css" media="screen" />


<script>
$(document).ready(function() {

	$(".change_password_dialog").fancybox({
		'opacity'		    : true,
		'overlayShow'	    : true,
		'width'				: 450,
		'height'			: 200,
        'autoScale'     	: false,
        'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe',
		'scrolling'         : 'no'

		//Just call $.fancybox.close() on your onClick event 
	});
});

</script>

<!-- page title -->
<title>Nu Skin Enterprises (Singapore) Pte Ltd Time Attendance Software</title>

</head>
<body>
<div id="wrapper">

	<div id="sitename" class="clear">
    	<!-- YOUR SITE NAME -->
		<h1><a href="#">Nu Skin Singapore</a></h1>
	</div>
	
	<div id="navbar">	
		<div class="clear">
			<ul class="sf-menu clear">
            	<!-- PAGE NAVIGATION -->
            	<?php if(isset($_SESSION['role'])) {?>
				<li class="<?php if(preg_match("/viewrecords.php/",$curl)) echo "selected"; ?>"><a href="viewrecords.php" ><span>View</span></a></li>
               	<li class="<?php if(preg_match("/download.php/",$curl)) echo "selected"; ?>"><a href="download.php"><span>Download</span></a></li>
				<?php } ?>
				<?php if(isset($_SESSION['role']) && $_SESSION['role'] == "Administrator") {?>
				<li class="<?php if(preg_match("/upload.php/",$curl)) echo "selected"; ?>"><a href="upload.php"><span>Upload</span></a></li>
				<?php }?>
				<?php if(isset($_SESSION['role']) && $_SESSION['role'] == "Supervisor") {?>
				<li class="<?php if(preg_match("/approval.php/",$curl)) echo "selected"; ?>"><a href="approval.php"><span>Approve</span></a></li>
				<?php }?>
				
				
			</ul>
		</div>
	</div>
	<!--  
		<div id="header" class="clear">
			<div class="header-text">
				<h2><strong>Pellentesque</strong> habitant morbi tristique </h2>			
			</div>
		</div>
		<div class="header-bottom"></div>
	-->
	<div id="body-wrapper">
	
    	<!-- BREADCRUMB NAVIGATION -->
		<div class="bcnav">
			<div class="bcnav-left">
					<div class="bcnav-right clear">
				<!-- 	<h3>you are here: <u>Collection</u></h3> -->
					<div class="login-box">
					<?php if(isset($_SESSION['name'])) { ?>
							 	Welcome, <strong> <?php echo $_SESSION['name'] ?></strong>  (<a href="taController.php?request=logout&return=<?php echo $domain?>/index.php">Logout</a> / <a class="change_password_dialog" href="changepassword.php">Change Password</a>)
					
					<?php } 
					       else { ?>
								<form id="login_form" method="post" action="taController.php?request=login&return=<?php echo $domain; ?>/index.php" enctype="multipart/form-data">
									
									User Id
									<input type="text" name="userid" />
									Password
									<input type="password" name="password" />
									<input class="loginbutton" value="Login" type="submit"/></p>
									<?php if(isset($_GET['result'])) {
											if($_GET['result'] == 'fail') { ?><div class="error">Invalid login details. Please try again.</div><?php } 
										  }?>
								</form>
								 
						<?php }?>
					</div>
					</div>
			</div>		
		</div>
		
		
		
		